<%@page import="dao.ClientDAO"%>
<%@page import="dao.GoodsDAO"%>
<%@page import="bean.Bean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@ include file="session.jsp" %>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="images/main.css" rel="stylesheet" type="text/css">
<script language="Javascript">
function rent(id)
{
	 document.getElementById("form"+id).submit();
}
</script>

</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td bgcolor="#FFFFFF">
<br>
   
      <table width="98%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
        <tr align="center" bgcolor="#F2FDFF">
          <td colspan="10"  class="optiontitle">租赁列表</td>
        </tr>
        <%
        	Bean bean = new Bean();
			ClientDAO dao = new ClientDAO();
			List list = new ArrayList();
			list=dao.rentList();
			if(list.size()==0){
         %>
          <tr align="center" bgcolor="#ffffff">
         <td colspan="10">对不起！目前数据库中还没有添加数据！</td>
        </tr>
        <%}else{ %>
        <tr align="center" bgcolor="#ebf0f7">
		  <td width="40">编号</td>
          <td width="30%">租赁者</td>
          <td width="10%">租赁器材</td>
          <td width="10%">租金</td>
          <td width="10%">租赁时间</td>
          <td width="20%">执行操作</td>
        </tr>
		<%
			for(int i=0; i<list.size();i++){
				bean=(Bean)list.get(i);
				
		 %>
		<%
			String content = bean.getName()+"租赁"+bean.getPname()+"交付租金："+bean.getMoney()+"元";
		 %>
		 <form id="form<%=bean.getId()%>" action="../ClientServlet?kind=5" method="post">
		 	<input type="hidden" name="id" value="<%=bean.getId()%>"/>
		 	<input type="hidden" name="pid" value="<%=bean.getPid()%>"/>
		 	<input type="hidden" name="content" value="<%=content%>"/>
		 	<input type="hidden" name="money" value="<%=bean.getMoney()%>"/>
		 </form>
        <tr align='center' bgcolor='#FFFFFF' onmouseover='this.style.background="#F2FDFF"' onmouseout='this.style.background="#FFFFFF"'>
		  <td><%=bean.getId() %></td>
		  <td><%=bean.getName() %></td>
		  <td><%=bean.getPname() %></td>
		  <td><%=bean.getMoney() %></td>
		  <td><%=bean.getTime() %></td>
          <td>
          		<IMG src="images/view.gif" align="absmiddle"><a style="cursor: pointer;" onclick="rent(<%=bean.getId()%>)">归还</a> 
        </tr>
		<%} }%>
		<tr bgcolor="#ebf0f7">
		  <td colspan="10" height="30">&nbsp;&nbsp;
		  </td>
		</tr>
   


      </table>
	  <br>

    </td>
  </tr>
</table>
</body>
</html>